<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="IndexUsuario.xhtml">

	<ui:define name="conteudo">
		<f:loadBundle basename="br.ucb.jogo.recursos.messages" var="msg" />
		<h:form id="form" rendered="true">
			<p:panel styleClass="FundoPaginaUsuario">
				<br />
				<br />
				<br />
				<center>
					<p:panel styleClass="PainelTrabalho">
						<h:outputText value="#{msg.CRIAR_PERSONAGEM}" />
					</p:panel>
					<p:dataTable emptyMessage="#{msg.NENHUMA_CLASSE}" var="classe"
						value="#{classeManagedBean.classes}" rowKey="#{classe.nome}"
						paginator="true" rows="10"
						filteredValue="#{classeManagedBean.filtroClasses}"
						id="TableClasses" styleClass="PainelTrabalho">

						<f:facet name="header">
							<h:outputText value="#{msg.LISTAR_CLASSE}" />
						</f:facet>

						<p:column headerText="#{msg.NOME}" sortBy="#{classe.nome}"
							filterBy="#{classe.nome}" id="nome">
							<h:outputText value="#{classe.nome}" />
						</p:column>

						<p:column headerText="#{msg.FORCA}" sortBy="#{classe.forca}"
							id="forca">
							<h:outputText value="#{classe.forca}" />
						</p:column>

						<p:column headerText="#{msg.AGILIDADE}"
							sortBy="#{classe.agilidade}" id="agilidade">
							<h:outputText value="#{classe.agilidade}" />
						</p:column>

						<p:column headerText="#{msg.DEFESA}" sortBy="#{classe.defesa}"
							id="defesa">
							<h:outputText value="#{classe.defesa}" />
						</p:column>

						<p:column headerText="#{msg.MANA}" sortBy="#{classe.mana}"
							id="mana">
							<h:outputText value="#{classe.mana}" />
						</p:column>
						<p:column headerText="#{msg.ESCOLHER}" id="escolher">
							<h:commandLink action="#{personagemManagedBean.saveClass}">
								<f:setPropertyActionListener
									target="#{personagemManagedBean.classe}" value="#{classe}" />
								<h:graphicImage url="/imagens/select.png" title="Selecionar"
									alt="Selecionar" />
							</h:commandLink>
						</p:column>
					</p:dataTable>
				</center>
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>
</html>
